home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 60 / 60.xpi / chrome / webdeveloper.jar / content / webdeveloper / dialogs / outline_elements.js < prev    next >
Text File  |  2009-06-30  |  2KB  |  52 lines

  1. // Cancels the outline elements
  2. function webdeveloper_cancelOutlineElements()
  3. {
  4.     window.opener.document.getElementById("webdeveloper-outline-custom-elements-menu").checked = false;
  5.  
  6.     window.close();
  7. }
  8.  
  9. // Initializes the outline elements dialog
  10. function webdeveloper_initializeOutlineElements()
  11. {
  12.     var color   = null;
  13.     var element = null;
  14.  
  15.     // Loop through the possible custom elements
  16.     for(var i = 1; i <= 5; i++)
  17.     {
  18.         color   = "webdeveloper.custom." + i + ".color";
  19.         element = "webdeveloper.custom." + i + ".element";
  20.  
  21.         // If the color is set
  22.         if(webdeveloper_isPreferenceSet(color))
  23.         {
  24.             document.getElementById(color).color = webdeveloper_getStringPreference(color, true);
  25.         }
  26.  
  27.         // If the element is set
  28.         if(webdeveloper_isPreferenceSet(element))
  29.         {
  30.             document.getElementById(element).value = webdeveloper_getStringPreference(element, true);
  31.         }
  32.     }
  33. }
  34.  
  35. // Saves the list of colors and elements to outline
  36. function webdeveloper_saveOutlineElements()
  37. {
  38.     var color   = null;
  39.     var element = null;
  40.  
  41.     // Loop through the possible custom elements
  42.     for(var i = 1; i <= 5; i++)
  43.     {
  44.         color   = "webdeveloper.custom." + i + ".color";
  45.         element = "webdeveloper.custom." + i + ".element";
  46.  
  47.         webdeveloper_setStringPreference(color, document.getElementById(color).color);
  48.         webdeveloper_setStringPreference(element, document.getElementById(element).value.trim());
  49.     }
  50.  
  51.     window.arguments[0].push(true);
  52. }